/*
    Dominate 3D - A cube-based game of life

    Copyright (C) 2007, Craig H. Miller (kidmosey@gmail.com)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __COLOR_H__
#define __COLOR_H__

class Color
{
public:
#define L2CF(val, shift) ((float )((val>>shift) & 0xFF) / 255.0f)
    Color(long c)
    : r(L2CF(c, 24)), g(L2CF(c, 16)), b(L2CF(c, 8)), a(L2CF(c, 0))
    {
    }
#undef L2CF

    Color(int _r, int _g, int _b, int _a = 255)
    : r((float)_r/255.0f), g((float)_g/255.0f), b((float)_b/255.0f), a((float)_a/255.0f)
    {
    }

    Color(float _r = 0.0f, float _g = 0.0f, float _b = 0.0f, float _a = 1.0f)
    : r(_r), g(_g), b(_b), a(_a)
    {
    }

    ~Color()
    {
    }

    float r,g,b,a;
};

#endif // __COLOR_H__
